<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Constructs EventHttpConnection object</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="class.eventhttpconnection.html">« EventHttpConnection</a></li>
      <li style="float: right;"><a href="eventhttpconnection.getbase.html">EventHttpConnection::getBase »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.eventhttpconnection.html">EventHttpConnection</a></li>
    <li>Constructs EventHttpConnection object</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="eventhttpconnection.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">EventHttpConnection::__construct</h1>
  <p class="verinfo">(PECL event &gt;= 1.2.6-beta)</p><p class="refpurpose"><span class="refname">EventHttpConnection::__construct</span> &mdash; <span class="dc-title">Constructs EventHttpConnection object</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-eventhttpconnection.construct-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><strong>EventHttpConnection::__construct</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam">
    <span class="type"><a href="class.eventbase.html" class="type EventBase">EventBase</a></span>
     <code class="parameter">$base</code>
   </span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam">
    <span class="type"><a href="class.eventdnsbase.html" class="type EventDnsBase">EventDnsBase</a></span>
     <code class="parameter">$dns_base</code>
   </span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam">
    <span class="type">string</span>
     <code class="parameter">$address</code>
   </span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$port</code>
   </span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam">
    <span class="type"><a href="class.eventsslcontext.html" class="type EventSslContext">EventSslContext</a></span>
     <code class="parameter">$ctx</code>
    <span class="initializer"> = <strong><code>null</code></strong></span>
   </span><br>)</div>

  <p class="para rdfs-comment">
   Constructs EventHttpConnection object.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-eventhttpconnection.construct-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>

     <code class="parameter">base</code>
    </dt>

    <dd>

     <p class="para">
      Associated event base.
     </p>
    </dd>

   
   
    <dt>

     <code class="parameter">dns_base</code>
    </dt>

    <dd>

     <p class="para">
      If
      <code class="parameter">dns_base</code>
      is <strong><code>null</code></strong>, hostname resolution will block.
     </p>
    </dd>

   
   
    <dt>

     <code class="parameter">address</code>
    </dt>

    <dd>

     <p class="para">
      The address to connect to.
     </p>
    </dd>

   
   
    <dt>

     <code class="parameter">port</code>
    </dt>

    <dd>

     <p class="para">
      The port to connect to.
     </p>
    </dd>

   
   
    <dt>

     <code class="parameter">ctx</code>
    </dt>

    <dd>

     <p class="para">
      <span class="classname"><a href="class.eventsslcontext.html" class="classname">EventSslContext</a></span>
      class object. Enables OpenSSL.
     </p>
     <blockquote class="note"><p><strong class="note">注意</strong>: 
      <p class="para">
       This parameter is available only if
       <code class="literal">Event</code>
       is compiled with OpenSSL support and only with
       <code class="literal">Libevent
        2.1.0-alpha</code>
       and higher.
      </p>
     </p></blockquote>
    </dd>

   
  </dl>

 </div>

 <div class="refsect1 returnvalues" id="refsect1-eventhttpconnection.construct-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns
   <span class="classname"><a href="class.eventhttpconnection.html" class="classname">EventHttpConnection</a></span>
   object.
  </p>
 </div>

 <div class="refsect1 changelog" id="refsect1-eventhttpconnection.construct-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>PECL event 1.9.0</td>
       <td>
        OpenSSL support (<code class="parameter">ctx</code>) added.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

</div></div></div></body></html>